using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace <Application>.<Presentation>
{
    public partial class frm<OwnerU>_<TableU> : BaseForm
    {
        public frm<OwnerU>_<TableU>()
        {
            InitializeComponent();
        }

        sr<Database>Data.<Database>DataServiceClient cls<Database>Data = new sr<Database>Data.<Database>DataServiceClient();
        sr<OwnerU>_<TableU>.I<OwnerU>_<TableU>ServiceClient cls<OwnerU>_<TableU>Data = new sr<OwnerU>_<TableU>.I<OwnerU>_<TableU>ServiceClient();
        <If Loop>
          <IsFKey>
        sr<OwnerU>_<TableU>Combo.I<OwnerU>_<TableU>ComboServiceClient cls<OwnerU>_<TableU>ComboData = new sr<OwnerU>_<TableU>Combo.I<OwnerU>_<TableU>ComboServiceClient();
	    <ExitLoop>
        </If Loop>
        
        private void frm<OwnerU>_<TableU>_Load(object sender, System.EventArgs e)
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            Screen = "<Head>";
            <If Loop>
            <IsFKey>
            Load<OwnerU>_<TableU>_<ROwnerU>_<RTableU>ComboBox<MiscTag>();
            </If Loop>
            LoadGridCode();
            ShowToolStripItems("Cancel");
            this.Cursor = System.Windows.Forms.Cursors.Default;
        }

        <If Loop>
        <IsFKey>
        private void Load<OwnerU>_<TableU>_<ROwnerU>_<RTableU>ComboBox<MiscTag>()
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            List<sr<OwnerU>_<TableU>Combo.<OwnerU>_<TableU>_<ROwnerU>_<RTableU>Class<MiscTag>> <OwnerU>_<TableU>_<ROwnerU>_<RTableU>List = new  List<sr<OwnerU>_<TableU>Combo.<OwnerU>_<TableU>_<ROwnerU>_<RTableU>Class<MiscTag>>();
            try
                {
                    <OwnerU>_<TableU>_<ROwnerU>_<RTableU>List = cls<OwnerU>_<TableU>ComboData.List<OwnerU>_<TableU>_<ROwnerU>_<RTableU><MiscTag>();
                    <IsFKey>
                    cb<FieldU>.DataSource = <OwnerU>_<TableU>_<ROwnerU>_<RTableU>List;
                    cb<FieldU>.DisplayMember = "<RDisplayFieldU>";
                    cb<FieldU>.ValueMember = "<RFieldU>";
                }
            catch (Exception ex)
                {
                     MessageBox.Show(ex.Message, ex.GetType().ToString());
            }
            this.Cursor = System.Windows.Forms.Cursors.Default;
        }

        </If Loop>
        protected override void LoadGridCode()
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            try
            { 
                gridCode.RowHeadersVisible = false;
                gridCode.DataSource = cls<OwnerU>_<TableU>DataClass.SelectAll().Tables[0];
                if (gridCode.Rows.Count == 0) {
                    ShowToolStripItems("No Record");
                }
                else
                {
                    ClearRecord();
        	<If Loop>
	          <IsMoney>
                    gridCode.Columns[<ColNo>].DefaultCellStyle.Format = "c";
		  <IsSmallMoney>
                    gridCode.Columns[<ColNo>].DefaultCellStyle.Format = "c";
                  <IsNumber>
                  <And>
                  <IsNotFKey>
                    gridCode.Columns[<ColNo>].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;
        	</If Loop>
                }
            }
            catch { }
            this.Cursor = System.Windows.Forms.Cursors.Default;
        }

        protected override void Display()
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            ClearRecord();

            sr<OwnerU>_<TableU>.<OwnerU>_<TableU>Class cls<OwnerU>_<TableU> = new sr<OwnerU>_<TableU>.<OwnerU>_<TableU>Class();
            <If Loop>
            <IsPKey>
            cls<OwnerU>_<TableU>.<FieldU> = <Convert>(gridCode[<ColNo>, Row].Value);
            </If Loop>
            <If Loop>
            <IsNotPKey>
            <And>
            <IsIdentity>
            cls<OwnerU>_<TableU>.<FieldU> = <Convert>(gridCode[<ColNo>, Row].Value);
            </If Loop>
            <If Loop>
            <IsNotIdentityCount>
            <And>
            <IsNotPKeyCount>
            cls<OwnerU>_<TableU>.<FieldU> = <Convert>(gridCode[<ColNo>, Row].Value);
            <ExitLoop>
            </If Loop>
            cls<OwnerU>_<TableU> = cls<OwnerU>_<TableU>DataClass.Select_Record(cls<OwnerU>_<TableU>);

            if (cls<OwnerU>_<TableU> != null){
                try
                { 
                    <If Loop>
                    <IsCheckBox>
                    <And>
                    <IsNull>
                    if (cls<OwnerU>_<TableU>.<Field> is null) { cb<FieldU>.Checked = default(<CSType>); } else { cb<FieldU>.Checked = <Convert>(cls<OwnerU>_<TableU>.<Field>); }
                    <IsNumericUpDown>
                    <And>
                    <IsNull>
                    if (cls<OwnerU>_<TableU>.<Field> is null) { nud<FieldU>.Value = default(<CSType>); } else { nud<FieldU>.Value = <Convert>(cls<OwnerU>_<TableU>.<Field>); }
                    <IsDateTimePicker>
                    <And>
                    <IsNull>
                    if (cls<OwnerU>_<TableU>.<Field> is null) { dtp<FieldU>.Value = DateTime.Now; } else { dtp<FieldU>.Value = <Convert>(cls<OwnerU>_<TableU>.<Field>); }
                    <IsTextBox>
                    <And>
                    <IsNull>
                    if (cls<OwnerU>_<TableU>.<Field> is null) { tb<FieldU>.Text = default(<CSType>); } else { tb<FieldU>.Text =  System.Convert.ToString(cls<OwnerU>_<TableU>.<Field>); }
                    <IsMaskedTextBox>
                    <And>
                    <IsNull>
                    if (cls<OwnerU>_<TableU>.<Field> is null) { mtb<FieldU>.Text = default(<CSType>); } else { mtb<FieldU>.Text =  System.Convert.ToString(cls<OwnerU>_<TableU>.<Field>); }
                    <IsMultilineTextBox>
                    <And>
                    <IsNull>
                    if (cls<OwnerU>_<TableU>.<Field> is null) { mtb<FieldU>.Text = default(<CSType>); } else { mtb<FieldU>.Text =  System.Convert.ToString(cls<OwnerU>_<TableU>.<Field>); }
                    <IsRichTextBox>
                    <And>
                    <IsNull>
                    if (cls<OwnerU>_<TableU>.<Field> is null) { rtb<FieldU>.Text = default(<CSType>); } else { rtb<FieldU>.Text =  System.Convert.ToString(cls<OwnerU>_<TableU>.<Field>); }
                    <IsPictureBox>
                    <And>
                    <IsNull>
                    if (cls<OwnerU>_<TableU>.<Field> is null) { pb<FieldU>.Value = default(<CSType>); } else { pb<FieldU>.Value = <Convert>(cls<OwnerU>_<TableU>.<Field>); }
                    <IsComboBox>
                    <And>
                    <IsNull>
                    if (cls<OwnerU>_<TableU>.<Field> is null) { cb<FieldU>.Text = default(<CSType>); } else { cb<FieldU>.Text =  System.Convert.ToString(cls<OwnerU>_<TableU>.<Field>); }
                    <IsComboBox (Db)>
                    <And>
                    <IsNull>
                    if (cls<OwnerU>_<TableU>.<Field> is null) { cb<FieldU>.SelectedValue = default(<CSType>); } else { cb<FieldU>.SelectedValue = <Convert>(cls<OwnerU>_<TableU>.<Field>); }
--------------------------------------------------------------------------------------------------------<Comment>
                    <IsCheckBox>
                    <And>
                    <IsNotNull>
                    cb<FieldU>.Checked = <Convert>(cls<OwnerU>_<TableU>.<Field>);
                    <IsNumericUpDown>
                    <And>
                    <IsNotNull>
                    nud<FieldU>.Value = <Convert>(cls<OwnerU>_<TableU>.<Field>);
                    <IsDateTimePicker>
                    <And>
                    <IsNotNull>
                    dtp<FieldU>.Value = <Convert>(cls<OwnerU>_<TableU>.<Field>);
                    <IsTextBox>
                    <And>
                    <IsNotNull>
                    tb<FieldU>.Text =  System.Convert.ToString(cls<OwnerU>_<TableU>.<Field>);
                    <IsMaskedTextBox>
                    <And>
                    <IsNotNull>
                    mtb<FieldU>.Text =  System.Convert.ToString(cls<OwnerU>_<TableU>.<Field>);
                    <IsMultilineTextBox>
                    <And>
                    <IsNotNull>
                    mtb<FieldU>.Text =  System.Convert.ToString(cls<OwnerU>_<TableU>.<Field>);
                    <IsRichTextBox>
                    <And>
                    <IsNotNull>
                    rtb<FieldU>.Text =  System.Convert.ToString(cls<OwnerU>_<TableU>.<Field>);
                    <IsPictureBox>
                    <And>
                    <IsNotNull>
                    pb<FieldU>.Value = <Convert>(cls<OwnerU>_<TableU>.<Field>);
                    <IsComboBox>
                    <And>
                    <IsNotNull>
                    cb<FieldU>.Text =  System.Convert.ToString(cls<OwnerU>_<TableU>.<Field>);
                    <IsComboBox (Db)>
                    <And>
                    <IsNotNull>
                    cb<FieldU>.SelectedValue = <Convert>(cls<OwnerU>_<TableU>.<Field>);
                    </If Loop>
                }
                catch{}
            }
            this.Cursor = System.Windows.Forms.Cursors.Default;
        }

        protected override void Add()
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            this.AddMode = true;
            this.EditMode = false;
            this.DeleteMode = false;

            ClearRecord();
            ShowToolStripItems("Add");
            
 -----------------------------------------------------<Comment>
            <If Loop>
            <IsUniqueIdentifier>
            <And>
            <IsTextBox>
            this.tb<FieldU>.Text = Guid.NewGuid().ToString();
            <IsUniqueIdentifier>
            <And>
            <IsMaskedTextBox>
            this.tb<FieldU>.Text = Guid.NewGuid().ToString();
            </If Loop>
 -----------------------------------------------------<Comment>
            <If Loop>
           <IsNotIdentity>
            <And>
            <IsCheckBox>
            cb<FieldU>.Select();
            <ExitLoop>
           <IsNotIdentity>
            <And>
            <IsNumericUpDown>
            nud<FieldU>.Select();
            <ExitLoop>
           <IsNotIdentity>
            <And>
            <IsDateTimePicker>
            dtp<FieldU>.Select();
            <ExitLoop>
           <IsNotIdentity>
            <And>
            <IsTextBox>
            tb<FieldU>.Select();
            <ExitLoop>
           <IsNotIdentity>
            <And>
            <IsMaskedTextBox>
            mtb<FieldU>.Select();
            <ExitLoop>
           <IsNotIdentity>
            <And>
            <IsMultilineTextBox>
            mtb<FieldU>.Select();
            <ExitLoop>
           <IsNotIdentity>
            <And>
            <IsRichTextBox>
            rtb<FieldU>.Select();
            <ExitLoop>
           <IsNotIdentity>
            <And>
            <IsPictureBox>
            pb<FieldU>.Select();
            <ExitLoop>
           <IsNotIdentity>
            <And>
            <IsComboBox>
            cb<FieldU>.Select();
            <ExitLoop>
           <IsNotIdentity>
            <And>
            <IsComboBox (Db)>
            cb<FieldU>.Select();
            <ExitLoop>
            </If Loop>
-----------------------------------------------------<Comment>
            <If Loop>
               <IsIdentity>
               <And>
               <IsNumericUpDown>
            nud<FieldU>.Value = cls<Database>Data.getAutoID("New", "<Table>");
            </If Loop>
            this.Cursor = System.Windows.Forms.Cursors.Default;
        }

        protected override void Edit()
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            AddMode = false;
            EditMode = true;
            DeleteMode = false;
        
            ShowToolStripItems("Edit");
            <If Loop>
            <IsNotIdentity>
            <And>
            <IsPKey>
            <And>
            <IsNumericUpDown>
            nud<FieldU>.Enabled = false;
            <IsNotIdentity>
            <And>
            <IsPKey>
            <And>
            <IsTextBox>
            tb<FieldU>.Enabled = false;
            <IsNotIdentity>
            <And>
            <IsPKey>
            <And>
            <IsMaskedTextBox>
            mtb<FieldU>.Enabled = false;
            <IsNotIdentity>
            <And>
            <IsPKey>
            <And>
            <IsMultilineTextBox>
            mtb<FieldU>.Enabled = false;
            <IsNotIdentity>
            <And>
            <IsPKey>
            <And>
            <IsRichTextBox>
            rtb<FieldU>.Enabled = false;
            <IsNotIdentity>
            <And>
            <IsPKey>
            <And>
            <IsComboBox (Db)>
            cb<FieldU>.Enabled = false;
            <IsNotIdentity>
            <And>
            </If Loop>
            <If Loop>
            <IsNotIdentityCount>
            <And>
            <IsNotPKeyCount>
            <And>
            <IsNumericUpDown>
            nud<FieldU>.Enabled = false;
            <ExitLoop>
            <IsNotIdentityCount>
            <And>
            <IsNotPKeyCount>
            <And>
            <IsTextBox>
            tb<FieldU>.Enabled = false;
            <ExitLoop>
            <IsNotIdentityCount>
            <And>
            <IsNotPKeyCount>
            <And>
            <IsMaskedTextBox>
            mtb<FieldU>.Enabled = false;
            <ExitLoop>
            <IsNotIdentityCount>
            <And>
            <IsNotPKeyCount>
            <And>
            <IsMultilineTextBox>
            mtb<FieldU>.Enabled = false;
            <ExitLoop>
            <IsNotIdentityCount>
            <And>
            <IsNotPKeyCount>
            <And>
            <IsRichTextBox>
            rtb<FieldU>.Enabled = false;
            <ExitLoop>
            <IsNotIdentityCount>
            <And>
            <IsNotPKeyCount>
            <And>
            <IsComboBox (Db)>
            cb<FieldU>.Enabled = false;
            <ExitLoop>
            </If Loop>
            <If Loop>
            <IsNotIdentity>
            <And>
            <IsNotPKey>
            <And>
            <IsCheckBox>
            cb<FieldU>.Select();
            <ExitLoop>
            <IsNotIdentity>
            <And>
            <IsNotPKey>
            <And>
            <IsNumericUpDown>
            nud<FieldU>.Select();
            <ExitLoop>
            <IsNotIdentity>
            <And>
            <IsNotPKey>
            <And>
            <IsDateTimePicker>
            dtp<FieldU>.Select();
            <ExitLoop>
            <IsNotIdentity>
            <And>
            <IsNotPKey>
            <And>
            <IsTextBox>
            tb<FieldU>.Select();
            <ExitLoop>
            <IsNotIdentity>
            <And>
            <IsNotPKey>
            <And>
            <IsMaskedTextBox>
            mtb<FieldU>.Select();
            <ExitLoop>
            <IsNotIdentity>
            <And>
            <IsNotPKey>
            <And>
            <IsMultilineTextBox>
            mtb<FieldU>.Select();
            <ExitLoop>
            <IsNotIdentity>
            <And>
            <IsNotPKey>
            <And>
            <IsRichTextBox>
            rtb<FieldU>.Select();
            <ExitLoop>
            <IsNotIdentity>
            <And>
            <IsNotPKey>
            <And>
            <IsComboBox>
            cb<FieldU>.Select();
            <ExitLoop>
            <IsNotIdentity>
            <And>
            <IsNotPKey>
            <And>
            <IsComboBox (Db)>
            cb<FieldU>.Select();
            <ExitLoop>
            </If Loop>
            this.Cursor = System.Windows.Forms.Cursors.Default;
-----------------------------------------------------<Comment>
        }

        protected override void Delete()
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            AddMode = false;
            EditMode = false;
            DeleteMode = true;

            ShowToolStripItems("Delete");
            this.Cursor = System.Windows.Forms.Cursors.Default;
        }

        protected override void EnableRecord(bool YesNo)
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            <If Loop>
            <IsNotIdentity>
            <And>
            <IsCheckBox>
            cb<FieldU>.Enabled = YesNo;
            <IsNotIdentity>
            <And>
            <IsNumericUpDown>
            nud<FieldU>.Enabled = YesNo;
            <IsNotIdentity>
            <And>
            <IsDateTimePicker>
            dtp<FieldU>.Enabled = YesNo;
            <IsNotIdentity>
            <And>
            <IsTextBox>
            tb<FieldU>.Enabled = YesNo;
            <IsNotIdentity>
            <And>
            <IsMaskedTextBox>
            mtb<FieldU>.Enabled = YesNo;
            <IsNotIdentity>
            <And>
            <IsMultilineTextBox>
            mtb<FieldU>.Enabled = YesNo;
            <IsNotIdentity>
            <And>
            <IsRichTextBox>
            rtb<FieldU>.Enabled = YesNo;
            <IsNotIdentity>
            <And>
            <IsPictureBox>
            pb<FieldU>.Enabled = YesNo;
            <IsNotIdentity>
            <And>
            <IsComboBox>
            cb<FieldU>.Enabled = YesNo;
            <IsNotIdentity>
            <And>
            <IsComboBox (Db)>
            cb<FieldU>.Enabled = YesNo;
            </If Loop>
            this.Cursor = System.Windows.Forms.Cursors.Default;
        }

        protected override void ClearRecord()
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            <If Loop>
            <IsCheckBox>
            cb<FieldU>.Text = null;
            <IsNumericUpDown>
            nud<FieldU>.Value = 0;
            <IsDateTimePicker>
            dtp<FieldU>.Text = null;
            <IsTextBox>
            tb<FieldU>.Text = null;
            <IsMaskedTextBox>
            mtb<FieldU>.Text = null;
            <IsMultilineTextBox>
            mtb<FieldU>.Text = null;
            <IsRichTextBox>
            rtb<FieldU>.Text = null;
            <IsPictureBox>
            pb<FieldU>.Text = null;
            <IsComboBox>
            cb<FieldU>.SelectedIndex = -1;
            <IsComboBox (Db)>
            cb<FieldU>.SelectedIndex = -1;
            </If Loop>
            this.Cursor = System.Windows.Forms.Cursors.Default;
        }

        private void SetData(sr<OwnerU>_<TableU>.<OwnerU>_<TableU>Class cls<OwnerU>_<TableU>)
        {
                <If Loop>
                    <IsNotIdentity>
                    <And>
                    <IsCheckBox>
                    <And>
                    <IsNull>
                    <And>
                    <IsNullable>
            cls<OwnerU>_<TableU>.<FieldU> = cb<FieldU>.Checked ? true : false;                        
                    <IsNotIdentity>
                    <And>
                    <IsNumericUpDown>
                    <And>
                    <IsNull>
                    <And>
                    <IsNullable>
            if (string.IsNullOrEmpty(nud<FieldU>.Text)) {
                cls<OwnerU>_<TableU>.<FieldU> = null;
            } else {
                cls<OwnerU>_<TableU>.<FieldU> = <Convert>(nud<FieldU>.Text); }
                    <IsNotIdentity>
                    <And>
                    <IsDateTimePicker>
                    <And>
                    <IsNull>
                    <And>
                    <IsNullable>
            if (string.IsNullOrEmpty(dtp<FieldU>.Text)) {
                cls<OwnerU>_<TableU>.<FieldU> = null;
            } else {
                cls<OwnerU>_<TableU>.<FieldU> = <Convert>(dtp<FieldU>.Text); }
                    <IsNotIdentity>
                    <And>
                    <IsTextBox>
                    <And>
                    <IsNull>
                    <And>
                    <IsNullable>
            if (string.IsNullOrEmpty(tb<FieldU>.Text)) {
                cls<OwnerU>_<TableU>.<FieldU> = null;
            } else {
                cls<OwnerU>_<TableU>.<FieldU> = <Convert>(tb<FieldU>.Text); }
                    <IsNotIdentity>
                    <And>
                    <IsMaskedTextBox>
                    <And>
                    <IsNull>
                    <And>
                    <IsNullable>
            if (string.IsNullOrEmpty(mtb<FieldU>.Text)) {
                cls<OwnerU>_<TableU>.<FieldU> = null;
            } else {
                cls<OwnerU>_<TableU>.<FieldU> = <Convert>(mtb<FieldU>.Text); }
                    <IsNotIdentity>
                    <And>
                    <IsMultilineTextBox>
                    <And>
                    <IsNull>
                    <And>
                    <IsNullable>
            if (string.IsNullOrEmpty(mtb<FieldU>.Text)) {
                cls<OwnerU>_<TableU>.<FieldU> = null;
            } else {
                cls<OwnerU>_<TableU>.<FieldU> = <Convert>(mtb<FieldU>.Text); }
                    <IsNotIdentity>
                    <And>
                    <IsRichTextBox>
                    <And>
                    <IsNull>
                    <And>
                    <IsNullable>
            if (string.IsNullOrEmpty(rtb<FieldU>.Text)) {
                cls<OwnerU>_<TableU>.<FieldU> = null;
            } else {
                cls<OwnerU>_<TableU>.<FieldU> = <Convert>(rtb<FieldU>.Text); }
                    <IsNotIdentity>
                    <And>
                    <IsPictureBox>
                    <And>
                    <IsNull>
                    <And>
                    <IsNullable>
                        
                    <IsNotIdentity>
                    <And>
                    <IsComboBox>
                    <And>
                    <IsNull>
                    <And>
                    <IsNullable>
            cls<OwnerU>_<TableU>.<FieldU> = <Convert>(cb<FieldU>.Text);
                    <IsNotIdentity>
                    <And>
                    <IsComboBox (Db)>
                    <And>
                    <IsNull>
                    <And>
                    <IsNullable>
            if (string.IsNullOrEmpty(cb<FieldU>.SelectedValue.ToString())) {
                cls<OwnerU>_<TableU>.<FieldU> = null;
            } else {
                cls<OwnerU>_<TableU>.<FieldU> = <Convert>(cb<FieldU>.SelectedValue); }
--------------------------------------------------------------------------------------------------------<Comment>
                    <IsNotIdentity>
                    <And>
                    <IsCheckBox>
                    <And>
                    <IsNull>
                    <And>
                    <IsNotNullable>
            cls<OwnerU>_<TableU>.<FieldU> = cb<FieldU>.Checked ? true : false;  
                    <IsNotIdentity>
                    <And>
                    <IsNumericUpDown>
                    <And>
                    <IsNull>
                    <And>
                    <IsNotNullable>
            if (string.IsNullOrEmpty(nud<FieldU>.Text)) {
                cls<OwnerU>_<TableU>.<FieldU> = null;
            } else {
                cls<OwnerU>_<TableU>.<FieldU> = <Convert>(nud<FieldU>.Text); }
                    <IsNotIdentity>
                    <And>
                    <IsDateTimePicker>
                    <And>
                    <IsNull>
                    <And>
                    <IsNotNullable>
            if (string.IsNullOrEmpty(dtp<FieldU>.Text)) {
                cls<OwnerU>_<TableU>.<FieldU> = null;
            } else {
                cls<OwnerU>_<TableU>.<FieldU> = <Convert>(dtp<FieldU>.Text); }
                    <IsNotIdentity>
                    <And>
                    <IsTextBox>
                    <And>
                    <IsNull>
                    <And>
                    <IsNotNullable>
            if (string.IsNullOrEmpty(tb<FieldU>.Text)) {
                cls<OwnerU>_<TableU>.<FieldU> = null;
            } else {
                cls<OwnerU>_<TableU>.<FieldU> = tb<FieldU>.Text; }
                    <IsNotIdentity>
                    <And>
                    <IsMaskedTextBox>
                    <And>
                    <IsNull>
                    <And>
                    <IsNotNullable>
            if (string.IsNullOrEmpty(mtb<FieldU>.Text)) {
                cls<OwnerU>_<TableU>.<FieldU> = null;
            } else {
                cls<OwnerU>_<TableU>.<FieldU> = mtb<FieldU>.Text; }
                    <IsNotIdentity>
                    <And>
                    <IsMultilineTextBox>
                    <And>
                    <IsNull>
                    <And>
                    <IsNotNullable>
            if (string.IsNullOrEmpty(mtb<FieldU>.Text)) {
                cls<OwnerU>_<TableU>.<FieldU> = null;
            } else {
                cls<OwnerU>_<TableU>.<FieldU> = mtb<FieldU>.Text; }
                    <IsNotIdentity>
                    <And>
                    <IsRichTextBox>
                    <And>
                    <IsNull>
                    <And>
                    <IsNotNullable>
            if (string.IsNullOrEmpty(rtb<FieldU>.Text)) {
                cls<OwnerU>_<TableU>.<FieldU> = null;
            } else {
                cls<OwnerU>_<TableU>.<FieldU> = rtb<FieldU>.Text; }
                    <IsNotIdentity>
                    <And>
                    <IsPictureBox>
                    <And>
                    <IsNull>
                    <And>
                    <IsNotNullable>
                        
                    <IsNotIdentity>
                    <And>
                    <IsComboBox>
                    <And>
                    <IsNull>
                    <And>
                    <IsNotNullable>
            cls<OwnerU>_<TableU>.<FieldU> = <Convert>(cb<FieldU>.Text);
                    <IsNotIdentity>
                    <And>
                    <IsComboBox (Db)>
                    <And>
                    <IsNull>
                    <And>
                    <IsNotNullable>
            if (string.IsNullOrEmpty(cb<FieldU>.SelectedValue.ToString())) {
                cls<OwnerU>_<TableU>.<FieldU> = null;
            } else {
                cls<OwnerU>_<TableU>.<FieldU> = <Convert>(cb<FieldU>.SelectedValue); }
--------------------------------------------------------------------------------------------------------<Comment>
                    <IsNotIdentity>
                    <And>
                    <IsCheckBox>
                    <And>
                    <IsNotNull>
            cls<OwnerU>_<TableU>.<FieldU> = <Convert>(cb<FieldU>.Checked ? true : false);
                    <IsNotIdentity>
                    <And>
                    <IsNumericUpDown>
                    <And>
                    <IsNotNull>
            cls<OwnerU>_<TableU>.<FieldU> = <Convert>(nud<FieldU>.Value);
                    <IsNotIdentity>
                    <And>
                    <IsDateTimePicker>
                    <And>
                    <IsNotNull>
            cls<OwnerU>_<TableU>.<FieldU> = <Convert>(dtp<FieldU>.Value);
                    <IsNotIdentity>
                    <And>
                    <IsTextBox>
                    <And>
                    <IsNotNull>
            cls<OwnerU>_<TableU>.<FieldU> = <Convert>(tb<FieldU>.Text);
                    <IsNotIdentity>
                    <And>
                    <IsMaskedTextBox>
                    <And>
                    <IsNotNull>
            cls<OwnerU>_<TableU>.<FieldU> = <Convert>(mtb<FieldU>.Text);
                    <IsNotIdentity>
                    <And>
                    <IsMultilineTextBox>
                    <And>
                    <IsNotNull>
            cls<OwnerU>_<TableU>.<FieldU> = <Convert>(mtb<FieldU>.Text);
                    <IsNotIdentity>
                    <And>
                    <IsRichTextBox>
                    <And>
                    <IsNotNull>
            cls<OwnerU>_<TableU>.<FieldU> = <Convert>(rtb<FieldU>.Text);
                    <IsNotIdentity>
                    <And>
                    <IsPictureBox>
                    <And>
                    <IsNotNull>
                        
                    <IsNotIdentity>
                    <And>
                    <IsComboBox>
                    <And>
                    <IsNotNull>
            cls<OwnerU>_<TableU>.<FieldU> = <Convert>(cb<FieldU>.Text);
                    <IsNotIdentity>
                    <And>
                    <IsComboBox (Db)>
                    <And>
                    <IsNotNull>
            cls<OwnerU>_<TableU>.<FieldU> = <Convert>(cb<FieldU>.SelectedValue);
--------------------------------------------------------------------------------------------------------<Comment>
                </If Loop>
        }

        protected override void InsertRecord()
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            sr<OwnerU>_<TableU>.<OwnerU>_<TableU>Class cls<OwnerU>_<TableU> = new sr<OwnerU>_<TableU>.<OwnerU>_<TableU>Class();
            if (VerifyData() == true) {
                SetData(cls<OwnerU>_<TableU>);
                Boolean bSucess = new Boolean();
                bSucess = cls<OwnerU>_<TableU>Data.Add(cls<OwnerU>_<TableU>);
                if (bSucess == true) {
                    GoBack_To_Grid(); }
                else {
                    MessageBox.Show("Insert failed.", "Error", MessageBoxButtons.OK); }
            }
            this.Cursor = System.Windows.Forms.Cursors.Default;
        }

        protected override void UpdateRecord()
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            sr<OwnerU>_<TableU>.<OwnerU>_<TableU>Class ocls<OwnerU>_<TableU> = new sr<OwnerU>_<TableU>.<OwnerU>_<TableU>Class();
            sr<OwnerU>_<TableU>.<OwnerU>_<TableU>Class cls<OwnerU>_<TableU> = new sr<OwnerU>_<TableU>.<OwnerU>_<TableU>Class();

            <If Loop>
            <IsPKey>
            ocls<OwnerU>_<TableU>.<FieldU> = <Convert>(gridCode[<ColNo>, Row].Value);
            </If Loop>
            <If Loop>
            <IsNotPKey>
            <And>
            <IsIdentity>
            ocls<OwnerU>_<TableU>.<FieldU> = <Convert>(gridCode[<ColNo>, Row].Value);
            </If Loop>
            <If Loop>
            <IsNotIdentityCount>
            <And>
            <IsNotPKeyCount>
            ocls<OwnerU>_<TableU>.<FieldU> = <Convert>(gridCode[<ColNo>, Row].Value);
            <ExitLoop>
            </If Loop>
            ocls<OwnerU>_<TableU> = cls<OwnerU>_<TableU>DataClass.Select_Record(ocls<OwnerU>_<TableU>);

            if (VerifyData() == true) {
                SetData(cls<OwnerU>_<TableU>);
                Boolean bSucess = new Boolean();
                bSucess = cls<OwnerU>_<TableU>DataClass.Update(ocls<OwnerU>_<TableU>, cls<OwnerU>_<TableU>);
                if (bSucess == true) {
                    GoBack_To_Grid(); }
                else {
                    MessageBox.Show("Update failed.", "Error", MessageBoxButtons.OK);}
            }
            this.Cursor = System.Windows.Forms.Cursors.Default;
        } 

        protected override void DeleteRecord()
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            sr<OwnerU>_<TableU>.<OwnerU>_<TableU>Class cls<OwnerU>_<TableU> = new sr<OwnerU>_<TableU>.<OwnerU>_<TableU>Class();
            <If Loop>
            <IsPKey>
            cls<OwnerU>_<TableU>.<FieldU> = <Convert>(gridCode[<ColNo>, Row].Value);
            </If Loop>
            <If Loop>
            <IsNotPKey>
            <And>
            <IsIdentity>
            cls<OwnerU>_<TableU>.<FieldU> = <Convert>(gridCode[<ColNo>, Row].Value);
            </If Loop>
            <If Loop>
            <IsNotIdentityCount>
            <And>
            <IsNotPKeyCount>
            cls<OwnerU>_<TableU>.<FieldU> = <Convert>(gridCode[<ColNo>, Row].Value);
            <ExitLoop>
            </If Loop>
            DialogResult result = MessageBox.Show("Are you sure? Delete this record?", "Delete", MessageBoxButtons.YesNo,  MessageBoxIcon.Question);
            {
            if (result == DialogResult.Yes) {
                SetData(cls<OwnerU>_<TableU>);
                Boolean bSucess = new Boolean();
                bSucess = cls<OwnerU>_<TableU>DataClass.Delete(cls<OwnerU>_<TableU>);
                if (bSucess == true) {
                    GoBack_To_Grid(); }
                else {
                    MessageBox.Show("Delete failed.", "Error", MessageBoxButtons.OK); }
                }
            }
        }  

        protected override Boolean VerifyData()
        {
            <If Loop>
            <IsNotIdentity>
            <And>
            <IsNotNull>
            <And>
            <IsCheckBox>
            
            <IsNotIdentity>
            <And>
            <IsNotNull>
            <And>
            <IsNumericUpDown>
            if (nud<FieldU>.Text == "") {
                MessageBox.Show("<FieldC> is Required", "Error", MessageBoxButtons.OK);
                nud<FieldU>.Select();
                return false;}
            <IsNotIdentity>
            <And>
            <IsNotNull>
            <And>
            <IsDateTimePicker>
            
            <IsNotIdentity>
            <And>
            <IsNotNull>
            <And>
            <IsTextBox>
            if (tb<FieldU>.Text == "") {
                MessageBox.Show("<FieldC> is Required", "Error", MessageBoxButtons.OK);
                tb<FieldU>.Select();
                return false;}
            <IsNotIdentity>
            <And>
            <IsNotNull>
            <And>
            <IsMaskedTextBox>
            if (mtb<FieldU>.Text == "") {
                MessageBox.Show("<FieldC> is Required", "Error", MessageBoxButtons.OK);
                mtb<FieldU>.Select();
                return false;}
            <IsNotIdentity>
            <And>
            <IsNotNull>
            <And>
            <IsMultilineTextBox>
            if (mtb<FieldU>.Text == "") {
                MessageBox.Show("<FieldC> is Required", "Error", MessageBoxButtons.OK);
                mtb<FieldU>.Select();
                return false;}
            <IsNotIdentity>
            <And>
            <IsNotNull>
            <And>
            <IsRichTextBox>
            if (rtb<FieldU>.Text == "") {
                MessageBox.Show("<FieldC> is Required", "Error", MessageBoxButtons.OK);
                rtb<FieldU>.Select();
                return false;}
            <IsNotIdentity>
            <And>
            <IsNotNull>
            <And>
            <IsPictureBox>
            
            <IsNotIdentity>
            <And>
            <IsNotNull>
            <And>
            <IsComboBox>
            if (cb<FieldU>.SelectedIndex == -1) {
                MessageBox.Show("<FieldC> is Required", "Error", MessageBoxButtons.OK);
                cb<FieldU>.Select();
                return false;}
            <IsNotIdentity>
            <And>
            <IsNotNull>
            <And>
            <IsComboBox (Db)>
            if (cb<FieldU>.SelectedIndex == -1) {
                MessageBox.Show("<FieldC> is Required", "Error", MessageBoxButtons.OK);
                cb<FieldU>.Select();
                return false;}          
            </If Loop>
---------------------------------------<Comment>
            <If Loop>
	            <IsNotIdentityCount>
            if (
	            <ExitLoop>
            </If Loop>
            <If Loop>
	            <IsNotIdentity>
	            <And>
	            <IsPKey>
	            <And>
	            <IsNumericUpDown>
            nud<FieldU>.Text != "" 
	            <ExitLoop>
             	    <IsNotIdentity>
	            <And>
	            <IsPKey>
	            <And>
	            <IsTextBox>
            tb<FieldU>.Text != "" 
	            <ExitLoop>
	            <IsNotIdentity>
	            <And>
	            <IsPKey>
	            <And>
	            <IsMaskedTextBox>
            mtb<FieldU>.Text != "" 
	            <ExitLoop>
	            <IsNotIdentity>
	            <And>
	            <IsPKey>
	            <And>
	            <IsMultilineTextBox>
            mtb<FieldU>.Text != "" 
	            <ExitLoop>
	            <IsNotIdentity>
	            <And>
	            <IsPKey>
	            <And>
	            <IsRichTextBox>
            rtb<FieldU>.Text != "" 
	            <ExitLoop>
	            <IsNotIdentity>
	            <And>
	            <IsPKey>
	            <And>
	            <IsComboBox (Db)>
            cb<FieldU>.SelectedIndex != -1 
	            <ExitLoop>
            </If Loop>
            <If Loop>
	            <IsNotIdentity>
	            <And>
	            <IsPKey>
	            <And>
	            <IsNumericUpDown>
           	    <And>
           	    <IsCurRow<>[0]>
            && nud<FieldU>.Text != "" 
             	    <IsNotIdentity>
	            <And>
	            <IsPKey>
	            <And>
	            <IsTextBox>
           	    <And>
           	    <IsCurRow<>[0]>
            && tb<FieldU>.Text != "" 
	            <IsNotIdentity>
	            <And>
	            <IsPKey>
	            <And>
	            <IsMaskedTextBox>
           	    <And>
           	    <IsCurRow<>[0]>
            && mtb<FieldU>.Text != "" 
	            <IsNotIdentity>
	            <And>
	            <IsPKey>
	            <And>
	            <IsMultilineTextBox>
           	    <And>
           	    <IsCurRow<>[0]>
            && mtb<FieldU>.Text != "" 
	            <IsNotIdentity>
	            <And>
	            <IsPKey>
	            <And>
	            <IsRichTextBox>
           	    <And>
           	    <IsCurRow<>[0]>
            && rtb<FieldU>.Text != "" 
	            <IsNotIdentity>
	            <And>
	            <IsPKey>
	            <And>
	            <IsComboBox (Db)>
           	    <And>
           	    <IsCurRow<>[0]>
            && cb<FieldU>.SelectedIndex != -1 
            </If Loop>
            <If Loop>
	            <IsNotIdentityCount>
	            <And>
	            <IsNotPKeyCount>
	            <And>
	            <IsNumericUpDown>
            nud<FieldU>.Text != "" 
	            <ExitLoop>
	            <IsNotIdentityCount>
	            <And>
	            <IsNotPKeyCount>
	            <And>
	            <IsTextBox>
            tb<FieldU>.Text != "" 
	            <ExitLoop>
	            <IsNotIdentityCount>
	            <And>
	            <IsNotPKeyCount>
	            <And>
	            <IsMaskedTextBox>
            mtb<FieldU>.Text != "" 
	           <ExitLoop>
	            <IsNotIdentityCount>
	            <And>
	            <IsNotPKeyCount>
	            <And>
	            <IsMultilineTextBox>
            mtb<FieldU>.Text != "" 
	           <ExitLoop>
	            <IsNotIdentityCount>
	            <And>
	            <IsNotPKeyCount>
	            <And>
	            <IsRichTextBox>
            rtb<FieldU>.Text != "" 
	            <ExitLoop>
	            <IsNotIdentityCount>
	            <And>
	            <IsNotPKeyCount>
	            <And>
	            <IsComboBox (Db)>
            cb<FieldU>.SelectedIndex != -1 
        	    <ExitLoop>
	            </If Loop>
            <If Loop>
	            <IsNotIdentityCount>
            )  {
            sr<OwnerU>_<TableU>.<OwnerU>_<TableU>Class cls<OwnerU>_<TableU> = new sr<OwnerU>_<TableU>.<OwnerU>_<TableU>Class();
	            <ExitLoop>
            </If Loop>
            <If Loop>
	            <IsNotIdentity>
	            <And>
	            <IsPKey>
	            <And>
	            <IsNumericUpDown>
            cls<OwnerU>_<TableU>.<FieldU> = <Convert>(nud<FieldU>.Value);
	            <IsNotIdentity>
	            <And>
	            <IsPKey>
	            <And>
	            <IsTextBox>
            cls<OwnerU>_<TableU>.<FieldU> = <Convert>(tb<FieldU>.Text);
	            <IsNotIdentity>
	            <And>
	            <IsPKey>
	            <And>
	            <IsMaskedTextBox>
            cls<OwnerU>_<TableU>.<FieldU> = <Convert>(mtb<FieldU>.Text);
	            <IsNotIdentity>
	            <And>
	            <IsPKey>
	            <And>
	            <IsMultilineTextBox>
            cls<OwnerU>_<TableU>.<FieldU> = <Convert>(mtb<FieldU>.Text);
	            <IsNotIdentity>
	            <And>
	            <IsPKey>
	            <And>
	            <IsRichTextBox>
            cls<OwnerU>_<TableU>.<FieldU> = <Convert>(rtb<FieldU>.Text);
	            <IsNotIdentity>
	            <And>
	            <IsPKey>
	            <And>
        	    <IsComboBox (Db)>
            cls<OwnerU>_<TableU>.<FieldU> = <Convert>(cb<FieldU>.SelectedValue);
            </If Loop>
            <If Loop>
	            <IsNotIdentityCount>
	            <And>
	            <IsNotPKeyCount>
	            <And>
	            <IsNumericUpDown>
            cls<OwnerU>_<TableU>.<FieldU> = <Convert>(nud<FieldU>.Value);
	            <ExitLoop>
	            <IsNotIdentityCount>
	            <And>
	            <IsNotPKeyCount>
	            <And>
	            <IsTextBox>
            cls<OwnerU>_<TableU>.<FieldU> = <Convert>(tb<FieldU>.Text);
	            <ExitLoop>
	            <IsNotIdentityCount>
	            <And>
	            <IsNotPKeyCount>
	            <And>
	            <IsMaskedTextBox>
            cls<OwnerU>_<TableU>.<FieldU> = <Convert>(mtb<FieldU>.Text);
	            <ExitLoop>
	            <IsNotIdentityCount>
	            <And>
	            <IsNotPKeyCount>
	            <And>
	            <IsMultilineTextBox>
            cls<OwnerU>_<TableU>.<FieldU> = <Convert>(mtb<FieldU>.Text);
	            <ExitLoop>
	            <IsNotIdentityCount>
	            <And>
	            <IsNotPKeyCount>
	            <And>
	            <IsRichTextBox>
            cls<OwnerU>_<TableU>.<FieldU> = <Convert>(rtb<FieldU>.Text);
	            <ExitLoop>
	            <IsNotIdentityCount>
	            <And>
	            <IsNotPKeyCount>
	            <And>
	            <IsComboBox (Db)>
            cls<OwnerU>_<TableU>.<FieldU> = <Convert>(cb<FieldU>.SelectedValue);
        	    <ExitLoop>
            </If Loop>
            <If Loop>
            <IsNotIdentityCount>
            cls<OwnerU>_<TableU> = <OwnerU>_<TableU>DataClass.Select_Record(cls<OwnerU>_<TableU>);
            if (cls<OwnerU>_<TableU> != null && this.AddMode == true) {
                 MessageBox.Show("Record already exists", "Error", MessageBoxButtons.OK);
            <ExitLoop>
            </If Loop>
            <If Loop>
            <IsNotIdentity>
            <And>
            <IsPKey>
            <And>
            <IsNumericUpDown>
                 nud<FieldU>.Select();
            <ExitLoop>
            <IsNotIdentity>
            <And>
            <IsPKey>
            <And>
            <IsTextBox>
                 tb<FieldU>.Select();
            <ExitLoop>
            <IsNotIdentity>
            <And>
            <IsPKey>
            <And>
            <IsMaskedTextBox>
                 mtb<FieldU>.Select();
            <ExitLoop>
            <IsNotIdentity>
            <And>
            <IsPKey>
            <And>
            <IsMultilineTextBox>
                   mtb<FieldU>.Select();
            <ExitLoop>
            <IsNotIdentity>
            <And>
            <IsPKey>
            <And>
            <IsRichTextBox>
                   rtb<FieldU>.Select();
            <ExitLoop>
            <IsNotIdentity>
            <And>
            <IsPKey>
            <And>
            <IsComboBox (Db)>
                   cb<FieldU>.Select();
            <ExitLoop>
            </If Loop>
            <If Loop>
            <IsNotIdentityCount>
            <And>
            <IsNotPKeyCount>
            <And>
            <IsNumericUpDown>
                   nud<FieldU>.Select();
            <ExitLoop>
            <IsNotIdentityCount>
            <And>
            <IsNotPKeyCount>
            <And>
            <IsTextBox>
                  tb<FieldU>.Select();
            <ExitLoop>
            <IsNotIdentityCount>
            <And>
            <IsNotPKeyCount>
            <And>
            <IsMaskedTextBox>
                   mtb<FieldU>.Select();
            <ExitLoop>
            <IsNotIdentityCount>
            <And>
            <IsNotPKeyCount>
            <And>
            <IsMultilineTextBox>
                  mtb<FieldU>.Select();
            <ExitLoop>
            <IsNotIdentityCount>
            <And>
            <IsNotPKeyCount>
            <And>
            <IsRichTextBox>
                  rtb<FieldU>.Select();
            <ExitLoop>
            <IsNotIdentityCount>
            <And>
            <IsNotPKeyCount>
            <And>
            <IsComboBox (Db)>
                   cb<FieldU>.Select();
            <ExitLoop>
            </If Loop>
            <If Loop>
            <IsNotIdentityCount>
                  return false; }
            <ExitLoop>
            </If Loop>
            <If Loop>
            <IsNotIdentityCount>
            }
            <ExitLoop>
            </If Loop>
---------------------------------------<Comment>
            return true;
        }

        <If Loop>
        <IsNotIdentity>
        <And>
        <IsFieldD>
        <And>
        <IsCheckBox>
        private void cb<FieldU>_GotFocus(object sender, System.EventArgs e)
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            SSLabel.Text = "<FieldD>";
            this.Cursor = System.Windows.Forms.Cursors.Default;
        }

        private void cb<FieldU>_LostFocus(object sender, System.EventArgs e)
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            SSLabel.Text = null;
            this.Cursor = System.Windows.Forms.Cursors.Default;
        }
        <IsNotIdentity>
        <And>
        <IsFieldD>
        <And>
        <IsNumericUpDown>
        private void nud<FieldU>_GotFocus(object sender, System.EventArgs e)
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            SSLabel.Text = "<FieldD>";
            this.Cursor = System.Windows.Forms.Cursors.Default;
        }

        private void nud<FieldU>_LostFocus(object sender, System.EventArgs e)
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            SSLabel.Text = null;
            this.Cursor = System.Windows.Forms.Cursors.Default;
        }
        <IsNotIdentity>
        <And>
        <IsFieldD>
        <And>
        <IsDateTimePicker>
        private void dtp<FieldU>_GotFocus(object sender, System.EventArgs e)
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            SSLabel.Text = "<FieldD>";
            this.Cursor = System.Windows.Forms.Cursors.Default;
        }

        private void dtp<FieldU>_LostFocus(object sender, System.EventArgs e)
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            SSLabel.Text = null;
            this.Cursor = System.Windows.Forms.Cursors.Default;
        }
        <IsNotIdentity>
        <And>
        <IsFieldD>
        <And>
        <IsTextBox>
        private void tb<FieldU>_GotFocus(object sender, System.EventArgs e)
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            SSLabel.Text = "<FieldD>";
            this.Cursor = System.Windows.Forms.Cursors.Default;
        }

        private void tb<FieldU>_LostFocus(object sender, System.EventArgs e)
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            SSLabel.Text = null;
            this.Cursor = System.Windows.Forms.Cursors.Default;
        }
        <IsNotIdentity>
        <And>
        <IsFieldD>
        <And>
        <IsMaskedTextBox>
        private void mtb<FieldU>_GotFocus(object sender, System.EventArgs e)
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            SSLabel.Text = "<FieldD>";
            this.Cursor = System.Windows.Forms.Cursors.Default;
        }

        private void mtb<FieldU>_LostFocus(object sender, System.EventArgs e)
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            SSLabel.Text = null;
            this.Cursor = System.Windows.Forms.Cursors.Default;
        }
        <IsNotIdentity>
        <And>
        <IsFieldD>
        <And>
        <IsMultilineTextBox>
        private void mtb<FieldU>_GotFocus(object sender, System.EventArgs e)
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            SSLabel.Text = "<FieldD>";
            this.Cursor = System.Windows.Forms.Cursors.Default;
        }

        private void mtb<FieldU>_LostFocus(object sender, System.EventArgs e)
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            SSLabel.Text = null;
            this.Cursor = System.Windows.Forms.Cursors.Default;
        }
        <IsNotIdentity>
        <And>
        <IsFieldD>
        <And>
        <IsRichTextBox>
        private void rtb<FieldU>_GotFocus(object sender, System.EventArgs e)
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            SSLabel.Text = "<FieldD>";
            this.Cursor = System.Windows.Forms.Cursors.Default;
        }

        private void rtb<FieldU>_LostFocus(object sender, System.EventArgs e)
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            SSLabel.Text = null;
            this.Cursor = System.Windows.Forms.Cursors.Default;
        }
        <IsNotIdentity>
        <And>
        <IsFieldD>
        <And>
        <IsPictureBox>
        private void pb<FieldU>_GotFocus(object sender, System.EventArgs e)
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            SSLabel.Text = "<FieldD>";
            this.Cursor = System.Windows.Forms.Cursors.Default;
        }

        private void pb<FieldU>_LostFocus(object sender, System.EventArgs e)
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            SSLabel.Text = null;
            this.Cursor = System.Windows.Forms.Cursors.Default;
        }
        <IsNotIdentity>
        <And>
        <IsFieldD>
        <And>
        <IsComboBox>
        private void cb<FieldU>_GotFocus(object sender, System.EventArgs e)
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            SSLabel.Text = "<FieldD>";
            this.Cursor = System.Windows.Forms.Cursors.Default;
        }

        private void cb<FieldU>_LostFocus(object sender, System.EventArgs e)
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            SSLabel.Text = null;
            this.Cursor = System.Windows.Forms.Cursors.Default;
        }
        <IsNotIdentity>
        <And>
        <IsFieldD>
        <And>
        <IsComboBox (Db)>
        private void cb<FieldU>_GotFocus(object sender, System.EventArgs e)
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            SSLabel.Text = "<FieldD>";
            this.Cursor = System.Windows.Forms.Cursors.Default;
        }

        private void cb<FieldU>_LostFocus(object sender, System.EventArgs e)
        {
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            SSLabel.Text = null;
            this.Cursor = System.Windows.Forms.Cursors.Default;
        }
        </If Loop>
    }
}





